package indi.zhang.rabbitmq.listener;

import com.alibaba.fastjson.JSONObject;
import indi.zhang.mq.MessageContent;
import indi.zhang.mq.api.Consumer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;

@Slf4j
public abstract class RabbitMqBaseListener implements Consumer {

    @RabbitHandler
    public void process(String msg) {
        MessageContent messageContent = JSONObject.parseObject(msg, MessageContent.class);
        this.deal(messageContent);
    }
}
